Skip to content

Fixes #39149: Keep MS Teams failed-rows table by bumping Adaptive Card to 1.5 - #39184

Merged
harshach merged 1 commit into
mainfrom
detail/bug-fix/fixes-39149-keep-ms-teams-failed-rows-table-by-bum-b0f93b
Nov 28, 2026
Merged

harshach merged 1 commit into
mainfrom
detail/bug-fix/fixes-39149-keep-ms-teams-failed-rows-table-by-bum-b0f93b

Conversation

@detail-app

@detail-app detail-app Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #39149

I bumped the Adaptive Card schema version declared by TeamsAdaptiveCardRenderer from "1.4" to "1.5" because data-quality alert cards now emit Table/TableRow/TableCell elements for failed rows, and those elements were introduced in Adaptive Cards schema 1.5. With the card still declaring 1.4, the Teams renderer treats the 1.5-only elements as unknown types and silently drops them, so MS Teams users receive alert cards missing the failed-rows table (the sampleData code block is unaffected — it takes a separate <pre><code> → monospace TextBlock path).

Type of change:

  • Bug fix

High-level design:

N/A — small change. One-line version bump in TeamsAdaptiveCardRenderer.java (the card builder), plus a regression test that locks the version invariant. TeamsCardAssembler already builds the Table family correctly; the only issue was the target schema version the card advertised. Teams supports Adaptive Cards 1.6 and earlier, so 1.5 is safe and the minimum required.

Tests:

Use cases covered

  • MS Teams data-quality alert with failed rows renders the failed-rows Table in the card (previously silently dropped).
  • MS Teams alert cards for non-table content (links, code, headings, plain text) still render, now under version 1.5.
  • The connection-test card (TeamsTestMessage, separate code path, version 1.0) is unchanged.

Unit tests

  • I added a unit test for the changed logic.
  • Files updated: openmetadata-service/src/test/java/org/openmetadata/service/alerting/channel/teams/TeamsAdaptiveCardRendererTest.java
    • adaptiveCardDeclaresVersionThatSupportsTableElements asserts the rendered AdaptiveCardContent version is >= "1.5", so any future change that emits Table elements cannot regress the version.
  • Existing teams package unit tests (TeamsCardAssemblerTest, TeamsMarkdownFormatterTest, TeamsTestMessageTest) pass unchanged — 15/15 green. mvn spotless:check and mvn compile -pl openmetadata-service pass.

Backend integration tests

  • Not applicable (no backend API changes). The renderer is exercised by DispatchScenariosIT indirectly; no integration test references the Teams renderer classes directly. Per the impact map, the only impacted unit test is TeamsAdaptiveCardRendererTest (PR CI runs unit tests; integration tests run in the merge queue).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. Brought up MySQL 8.4 + Elasticsearch 9.3.0 in Docker, ran DB migrations, and started the openmetadata-service server built from this branch (the patched TeamsAdaptiveCardRenderer).
  2. Logged in as admin and created an MS_TEAMS alert subscription pointing at a local HTTP receiver (http://localhost:9999/teams). Worked around the outbound SSRF policy, which rejects loopback address literals but allows the localhost hostname, by using localhost.
  3. Reproduced the exact bug scenario via REST: created a DatabaseService → Database → Schema → Table → TestCase (tableRowCountToEqual), posted a failed TestCaseResult with sampleData, stored failedRowsSample (PUT /testCases/{id}/failedRowsSample), and posted a second failed result to emit a change event after the sample was stored.
  4. The alert poller dispatched the Teams card to the receiver. The captured payload was "type":"AdaptiveCard","version":"1.5" with a Table body item (nested in a Container) containing 3 TableRows (header "Record 1" + the two failed rows) with TableCell children and horizontalCellContentAlignment:"Left" — the content that was silently dropped before the fix. Earlier captured cards for non-table events also carried version:"1.5" with no Table, confirming no regression for other content.
  5. Serialized a rendered card with JsonUtils.pojoToJson to confirm the wire format contains "version":"1.5" (not "1.4") and "type":"Table".

UI screen recording:

Not applicable — backend-only renderer change, no UI impact.

Checklist:

  • I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. (N/A — no schema changes)
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). (N/A — no UI changes)
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). (N/A — no durable decision beyond the one-line version bump that the regression test already enforces.)

Bug fix

  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.

Automatic Fixes PRs can be configured here.

@detail-app
detail-app Bot requested a review from a team as a code owner November 28, 2026 03:19
@harshach
harshach merged commit 7c831ba into main Nov 28, 2026
33 checks passed
@harshach
harshach deleted the detail/bug-fix/fixes-39149-keep-ms-teams-failed-rows-table-by-bum-b0f93b branch November 28, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] MS Teams data-quality alert cards drop failed-rows table due to Adaptive Card version mismatch

3 participants